//
// Created by HZH on 2023-05-02.
//

#ifndef BZDB_BZDB_BZMAP_T_H
#define BZDB_BZDB_BZMAP_T_H


#include "../BzDB_type.h"

// 定义一个结构体，.c中都是关于他的操作
typedef struct BzDB_BzMap_t{

    void * name_list;
    int name_size;

    void * buf;
    void * end;
    int buffer_size;

    int max_len;
    int used_count;
}BzDB_BzMap_t;

#ifdef __cplusplus
extern "C"{
#endif

void BzDB_BzMap_init(BzDB_BzMap_t *bzMap,void * buf, int buffer_size , void * name_list , int name_size,int max_len);
int BzDB_BzMap_find_name(BzDB_BzMap_t *bzMap , const char * name);
void BzDB_BzMap_set(BzDB_BzMap_t *bzMap , const char* name, void * data);
CCBOOL BzDB_BzMap_get(BzDB_BzMap_t *bzMap , const char* name, void * data);
CCBOOL BzDB_BzMap_delete(BzDB_BzMap_t *bzMap , const char* name , void * res);


void BzDB_BzMap_demo();
#ifdef __cplusplus
};
#endif

#endif //BZDB_BZDB_BZMAP_T_H
